package slxy.jiangtao.dts.core.common.bean;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import javax.persistence.criteria.CriteriaBuilder;
import java.io.File;
import java.util.Arrays;
import java.util.List;

/**
 * 系统常用常量配置
 * Created by Jiang Tao on 2017/1/31.
 */

public abstract class Constants {
    /**
     * 全局日志
     */
    public static final Logger LOG = LoggerFactory.getLogger(Constants.class);

    /**
     * 保存在http session中的用户对象
     */
    public static final String USER_IN_SESSION = "user_session_key";

    /**
     * 保存在http session中的菜单集合
     */
    public static final String MENUS_IN_SESSION = "menus_session_key";

    /**
     * 实体创建时间属性
     */
    public static final String CREATE_TIME = "createTime";

    /**
     * 实体更新时间属性
     */
    public static final String UPDATE_TIME = "updateTime";

    /**
     * 实体删除属性
     */
    public static final String DEL_FLAG = "delFlag";

    /**
     * Session失效时间,单位秒
     */
    public static final int MAX_SESSION_INACTIVE_INTERVAL = 3600;

    /**
     * 默认当前页码
     */
    public static final int DEFAULT_CURRENT_PAGE = 1;

    /**
     * 默认一页显示数据条数
     */
    public static final int DEFAULT_PAGE_SIZE = 15;

    /**
     * 验证码标识
     */
    public static final String VALID_CODE = "validCode";

    /**
     * 删除标识：正常
     */
    public static final int DEL_FLAG_NORMAL = 0;

    /**
     * 删除标识：已删除
     */
    public static final int DEL_FLAG_DELETED = 1;

    /**
     * 在职标识：在职
     */
    public static final int STATU_FLAG_NORMAL = 0;

    /**
     * 在职标识：离职
     */
    public static final int STATU_FLAG_Leave = 1;

    /**
     * JSON数据返回成功信息提示
     */
    public static final String JSON_BACK_SUCCESS = "成功";

    /**
     * JSON数据返回失败信息提示
     */
    public static final String JSON_BACK_FAILURE = "失败";

    /**
     * 返回失败的提示信息的key
     */
    public static final String FAILURE_KEY = "error";

    /**
     * 登录状态过期
     */
    public static final String APP_LOGIN_EXPIRED = "登录已过期，请重新登录";

    /**
     * 非法访问
     */
    public static final String APP_ILLEGALITY_LOGIN = "非法访问，请先登录";

    /**
     * RESPONSE输出JSON类型
     */
    public static final String JSON_CONTENT_TYPE = "application/json;charset=utf-8";

    /**
     * RESPONSE输出文本类型
     */
    public static final String TEXT_CONTENT_TYPE = "application/text;charset=utf-8";

    /**
     * UTF-8编码
     */
    public static final String UTF_8 = "UTF-8";

    /**
     * 英文状态逗号
     */
    public static final String COMMA = ",";


    /**
     * 英文状态竖线分隔符
     */
    public static final String PIPE = "\\|";

    /**
     * ISO-8859-1编码
     */
    public static final String ISO_8859_1 = "ISO-8859-1";

    /**
     * 包基本路径
     */
    public static final String BASE_ENTITY_PACKAGE = "slxy.jiangtao.dts.entity.";
    /**
     * sys包基本路径
     */
    public static final String BASE_ENTITY_PACKAGE_SYS = "slxy.jiangtao.dts.entity.sys.";
    /**
     * business包基本路径
     */
    public static final String BASE_ENTITY_PACKAGE_BUSINESS = "slxy.jiangtao.dts.entity.business.";

    /**
     * 表单提交查询对象FormQuery时在表单中的提交字段
     */
    public static final String EXPORT_FORM_SUMIT_FIELD = "query";

    /**
     * 上传的文件根路径路径
     */
    public static final String UPLOAD_ROOT = "F:" + File.separator + "dts" + File.separator + "upload" + File.separator;

    /**
     * 系统ueditor上传图片资源文件存放的根目录
     */

    public static final String UEDITOR_PATH = UPLOAD_ROOT + "ueditor";

    /**
     * uploadify资源存放的根目录
     */
    public static final String UPLOADIFY_PATH = UPLOAD_ROOT + "uploadify";

    /**
     * 允许上传的文件类型
     */
    public static final String[] ALLOW_EXTS = new String[]{"png", "jpg", "jpeg", "gif", "bmp", "pdf", "doc", "docx", "xls", "xlsx", "ppt", "pptx"};


    /**
     * 允许上传的word文件类型
     */
    public static final String[] Allow_EXTS_WORD = new String[]{"doc", "docx"};

    /**
     * 任务完成状态
     */
    public static final Integer TASK_ING = 0;

    /**
     * 任务完成状态
     */
    public static final Integer TASK_ED = 1;

    /**
     * 干部类型集合
     */
    public static final List<String> MANAGER_IDS = Arrays.asList("2", "3");

    /**
     * 干部类型集合
     */
    public static final String WORD_fileExt = "doc";

    /**
     * ueditor封装word标题左边
     */
    public static final String WORD_TITLE_LEFT = "<p style='line-height: 29px; margin-top: 5px; text-align: center;'><span style=';font-family: 宋体;color:black'>&nbsp; <strong>";

    /**
     * ueditor封装word标题右边
     */
    public static final String WORD_TITLE_RIGHT = "&nbsp;&nbsp;&nbsp;&nbsp; <br/></strong></span></p>";

    /**
     * ueditor封装word记者第一部分
     */
    public static final String WORD_REPORTOR_ONE = "<p style='text-align: center;'><strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</strong><strong><span style='font-size: 10px;'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 文字：</span></strong><span style='font-size: 10px;'>";

    /**
     * ueditor封装word记者第二部分
     */
    public static final String WORD_REPORTOR_TWO = "&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; <strong>摄影</strong>：";

    /**
     * ueditor封装word记者第三部分
     */
    public static final String WORD_REPORTOR_THREE = "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <strong>发布时间：</strong>";

    /**
     * ueditor封装word记者第四部分
     */
    public static final String WORD_REPORTOR_FOUR = "<br/></span></p>";

    /**
     * jacob对word转html文件后的后缀名
     */
    public static final String SUFFIX_HTML = ".html";

    /**
     * 系统邮箱账号
     */
    public static final String SYSTEM_EMAIL = "slxy_jiangtao@163.com";

    /**
     * 系统邮箱账号昵称
     */
    public static final String EMAIL_SENDTOR = "商洛学院大学生通讯社";

    /**
     * 邮件未发送状态值
     */
    public static final Integer EMAIL_UNSEND = 0;

    /**
     * 邮件已发送状态值
     */
    public static final Integer EMAIL_SENDED = 1;

    /**
     * 邮件删除状态值
     */
    public static final Integer EMAIL_DELETE = 2;

    /**
     * 邮件未读状态值
     */
    public static final Integer EMAIL_UNREAD = 0;

    /**
     * 邮件已读状态值
     */
    public static final Integer EMAIL_READ = 1;
}
